package com.dailyblue.java.spring.ioc.demo4;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
// 指定id名称
@Service("demoB")
public class DemoB {
    @Autowired   // byType
    private DemoA da;
    @Resource    // 1.byName + 2.byType
    private DemoA da2;

    @Override
    public String toString() {
        return "DemoB{" +
                "da=" + da +
                ", da2=" + da2 +
                '}';
    }
}
